{include file='public/header.html'}

<div class="container blog mtn">

    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="glyphicon glyphicon-book"></i> 私有文集
            {if session('user.level')>=2:}
            <span class="pull-right"><a href="{:url('book/add')}"><i class="glyphicon glyphicon-plus"></i> 添加文集</a></span>
            {/if}
        </div>
        <div class="panel-body row">

            {php $list=db('book')->where('status=1 AND is_public=0')->order('is_top DESC,sort ASC,id DESC')->cache()->paginate(12)}
            {foreach $list as $vo}
            {php $start_id=get_start_id($vo['id'])}
            <div class="col-lg-3">
                <div class="panel panel-default">
                    <a href="{:url('doc/read',['id'=>$start_id])}">
                        <img class="card-img-top" src="{:rand_thumb($vo['thumb'], $vo['id'])}" width="100%" alt="{$vo.title}" />
                    </a>
                    <div class="panel-body">
                        <h4 class="card-title">{if $vo['is_top']==1:}<span class="text-danger">置顶</span> {/if}<a href="{:url('book/detail',['id'=>$vo['id']])}">{$vo.title}</a></h4>
                        <div class="card-text summary">{$vo.summary|str_substr=90}</div>
                    </div>
                    <div class="panel-footer text-right">
                        <a href="{:url('user/info',['id'=>$vo['user_id']])}"><i class="glyphicon glyphicon-user"></i> {$vo.user_id|get_nickname}</a>&nbsp;
                        <a href="{:url('book/down', ['id'=>$vo['id']])}"><i class="glyphicon glyphicon-download"></i> 下载</a>
                    </div>
                </div>
            </div>
            {/foreach}
        </div>
        <div class="panel-footer">{$list->links()}</div>
    </div>

</div>

{include file='public/footer.html'}
</body>
</html>